package service.Impl;

import dao.AdoptDao;
import dao.Impl.AdoptDaoImpl;
import entity.AdoptAnimal;
import service.AdoptService;

import java.time.LocalDate;
import java.util.List;

public class AdoptServiceImpl implements AdoptService {
    private AdoptDao adoptDao = new AdoptDaoImpl();
    @Override
    public List<AdoptAnimal> findAllPending() {
        return adoptDao.findAllPending();
    }

    @Override
    public List<AdoptAnimal> findByAdoptTime(LocalDate adoptTime) {
        return adoptDao.findByAdoptTime(adoptTime);
    }

    @Override
    public boolean agreeAdopt(int id) {
       return adoptDao.agreeAdopt(id);

    }

    @Override
    public boolean disagreeAdopt(int id) {
       return adoptDao.disagreeAdopt(id);

    }

    @Override
    public List<AdoptAnimal> findAgreeAll() {
        adoptDao.findAllPending();
        return adoptDao.findAgreeAll();
    }

    @Override
    public List<AdoptAnimal> findDisagreeAll() {
        adoptDao.findAllPending();
        return adoptDao.findDisagreeAll();
    }

    @Override
    public List<AdoptAnimal> finfByUsername(String username) {
        return adoptDao.finfByUsername(username);
    }

    @Override
    public void save(AdoptAnimal adoptAnimal) {
        adoptDao.save(adoptAnimal);
    }
}
